package com.foreknow.mapping;

import com.foreknow.model.Guestbook;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * Created by foreknow on 2022/3/21.
 */
public class GuestbookMapping implements EntityMapping{

    @Override
    public Object mapping(ResultSet rs) throws SQLException {
        Guestbook guestBook = new Guestbook();
        guestBook.setId(rs.getInt("id"));
        guestBook.setName(rs.getString("name"));
        guestBook.setPhone(rs.getString("phone"));
        guestBook.setEmail(rs.getString("email"));
        guestBook.setTitle(rs.getString("title"));
        guestBook.setContent(rs.getString("content"));
        guestBook.setCreatetime(rs.getString("createtime"));
        return guestBook;
    }
}
